﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Adams.Web.Areas.MyAdams.Logic.Businesses
{
    public static class Index
    {
        public static MyAdams.Models.Businesses.Index.PageLoad PageLoad(int memberid)
        {
            return MyAdams.Data.Businesses.Index.PageLoad(memberid);
        }

        public static Adams.Web.Models.FormOutput Renew(int memberId, int businessId)
        {
            var output = new Adams.Web.Models.FormOutput();
            var expiresOn = DateTime.Now.AddYears(1);
            MyAdams.Data.Businesses.Index.Renew(memberId, businessId, expiresOn);
            output.ID = businessId;
            output.IsSaved = true;

            return output;
        }

        public static Adams.Web.Models.FormOutput Remove(int memberId, int businessId)
        {
            var output = new Adams.Web.Models.FormOutput();
            MyAdams.Data.Businesses.Index.Remove(memberId, businessId);
            output.ID = businessId;
            output.IsSaved = true;
            return output;
        }
    }
}